package com.leo;

import javafx.beans.property.SimpleIntegerProperty;

/**
 * @ClassName TwoWayBindingDemo
 * @Description 双向绑定
 * @Author wangss
 * @date 2020.05.29 11:25
 * @Version 1.0
 */
public class TwoWayBindingDemo {

    public static void main(String[] args) {

        SimpleIntegerProperty x = new SimpleIntegerProperty(1);

        SimpleIntegerProperty y = new SimpleIntegerProperty(5);

        // 双向绑定，改变互相影响
        x.bindBidirectional(y);

        System.out.println(x);
        System.out.println(y);
    }
}
